<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

	<head>
		<title>联通cp报表</title>
		<link rel="stylesheet" href="">
		<script type="text/javascript" src="/cp/Public//js/jquery.min.js"></script>
		<script type="text/javascript" src="/cp/Public//js/jquery.SuperSlide.js"></script>
		<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
		<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
		<link rel="stylesheet" href="/cp/Public/css/public.css">
		<link rel="stylesheet" type="text/css" href="/cp/Public//Css/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="/cp/Public//Css/bootstrap-responsive.css" />
		<!--    <link rel="stylesheet" type="text/css" href="/cp/Public//Css/style.css" /> -->
		<style type="text/css" media="screen">
			/*  table {
        width: 80%;
        height: 100%;
        margin: 0 auto;
        background-color: #FFFAFA;
        border: 0px;
    }
    
    th {
       
        border: 0px;
    }
    
    td {
        border: 0px;
    } */
			
			form {
				width: 80%;
				margin: 0 auto;
			}
			
			#download {
				width: 100%;
				text-align: left;
				height: 31px;
				margin: 0px auto;
				z-index: 100;
				_position: relative;
				_top: 0px;
			}
			
			a {
				text-decoration: none;
			}
			
			#select_date {
				width: 50%;
				margin: 0px auto;
				float: right;
				_position: fixed;
				margin-bottom: 18px;
			}
			
			#dv_r {
				width: 200px;
				float: right;
				margin-right: 20px;
				_position: relative;
			}
			
			#refresh {
				float: right;
				margin-right: 20px;
				_position: relative;
			}
		</style>
		<script type="text/javascript">
			$(function() {
			        $("#datepicker-start,#datepicker-end").datepicker({
			            dateFormat: 'yy-mm-dd',
			            showButtonPanel: true,
			
			
			
			
			        });
			        $('td[onclick]').mousemove(function(event) {
			            this.style.backgroundColor = 'grey';
			        });
			
			        $('td[onclick]').mouseout(function(event) {
			            this.style.backgroundColor = 'white';
			        });
			
			        $("#autorefresh").text("时间");
			        var pagesize = "<?php echo ($pagesize); ?>";
			        $("#pagesize").val(pagesize);
			
			        // $("option").map(function() {
			        //     if($(this).val()==pagesize){
			        //        alert($(this).val());
			        //        $(this)['selected'] = true;
			        //     }
			        // });
			
			
			    });
			
			    function refresh() {
			        var start = $('#datepicker-start').val();
			        var end = $('#datepicker-end').val();
			        var r = $('#pagesize option:selected').val();
			        // alert(altFormat);
			        window.location = "<?php echo U('Unicom/report/index');?>" + "/date_time/" + start + "/date_end/" + end + "/r/" + r;
			
			        //   $("#container").load(url + "#container");
			    }
			
			    //'dialogWidth:400px;dialogHeight:300px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes'
			    function trClick(servcode, date,tag) {
			        // alert(servcode);
			        //showModalDialog('http://www.jb51.net,'脚本之家');
			        var mocontent = servcode;

			        showModalDialog("<?php echo U('province/search',array('timeStamp'=>time()));?>" + "/servcode/" + servcode +"/mocontent/"+mocontent+ "/date/" + date + "/tag/" +tag, "手机号所属省份", "dialogWidth:800px;dialogHeight:600px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes;toolbar=no");
			    }
		</script>
	</head>

	<body>
		<div id="download">
			<a href="<?php echo U('Unicom/report/exportTable',array('date_time'=>$now,'type'=>0,'date_end'=>$date_end));?>">下载表1</a>
			<a href="<?php echo U('Unicom/report/exportTable',array('date_time'=>$now,'type'=>1,'date_end'=>$date_end));?>">下载表2</a>
			<a href="<?php echo U('Unicom/report/exportTable',array('date_time'=>$now,'type'=>2,'date_end'=>$date_end));?>">下载表3</a>
			<a id="select_date">起始日期：<input type="text" id="datepicker-start" value="<?php echo ($now); ?>">  终止日期：<input type="text" id="datepicker-end" value="<?php echo ($date_end); ?>"</a>
			<a id='refresh' onclick="refresh()">刷新</a> &nbsp;&nbsp;
			<select id="pagesize">
				<option value="10">10条</option>
				<option value="20">20条</option>
				<option value="30">30条</option>
				<option value="40">40条</option>
			</select>
		</div>
		<table class="table table-bordered table-hover definewidth m10">
			<thead>
				<tr>
					<th>日期</th>
					<th>指令</th>
					<th>上行数</th>
					<th>成功数</th>
					<th>同步成功数</th>
				</tr>
			</thead>
			<tbody>
				<?php if(is_array($list)): foreach($list as $key=>$vo): ?><tr>
						<td><?php echo ($vo["date"]); ?></td>
						<td><?php echo ($vo["mocontent"]); ?></td>
						<td onclick="trClick('<?php echo ($vo["mocontent"]); ?>','<?php echo ($vo["date"]); ?>','0')" style="cursor:pointer"><?php echo ($vo["count"]); ?></td>
						<td onclick="trClick('<?php echo ($vo["mocontent"]); ?>','<?php echo ($vo["date"]); ?>','1')" style="cursor:pointer"><?php echo ($vo["succ_ok"]); ?></td>
						<td onclick="trClick('<?php echo ($vo["mocontent"]); ?>','<?php echo ($vo["date"]); ?>','2')" style="cursor:pointer"><?php echo ($vo["sync_ok"]); ?></td>
					</tr><?php endforeach; endif; ?>
			</tbody>
		</table>
		<?php echo ($page); ?>
		<br>
		<!-- <form action="<?php echo U('Unicom/report/index');?>"  method="post" accept-charset="utf-8">
    <label for="meeting">日期：</label><input id="meeting"  name="date_time" type="date" value="<?php echo ($now); ?>"/>
    <input type="submit" value="提交">
</form> -->
	</body>

</html>